package com.michale.common.domain.operate;

import com.michale.common.utils.String.StringUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;

/**
 * @author Michale
 * @apiNote 缓存管理 实体类
 */
@Data
@ApiModel(value = "缓存管理", description = "参数配置表")
public class CacheEntity {
    /**
     * 缓存名称
     */
    private String cacheName = "";

    /**
     * 缓存键名
     */
    private String cacheKey = "";

    /**
     * 缓存内容
     */
    private String cacheValue = "";

    /**
     * 备注
     */
    private String remark = "";

    public CacheEntity(String cacheName, String remark) {
        this.cacheName = cacheName;
        this.remark = remark;
    }

    public CacheEntity(String cacheName, String cacheKey, String cacheValue) {
        this.cacheName = StringUtils.replace(cacheName, ":", "");
        this.cacheKey = StringUtils.replace(cacheKey, cacheName, "");
        this.cacheValue = cacheValue;
    }
}
